<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>oop</title>
</head>
<body>
	

	<script>

		'use strict';
		
		class Animal {
			constructor(name) {
				console.log(1);
				this.name = name;
			}

			move() {
				console.log(this.name + ' is moving...');
			}
		}

		class Dog extends Animal {
			constructor(name, color) {
				super(name);
				console.log(2);
				this.color = color;
			}

			/*move() {
				console.log(this.name + ' is a dog, and it is moving...');
			}*/

			wow() {
				console.log('wow!!! ' + this.name + ' is a dog, it\' color is ' + this.color);
			}
		}

		var animal = new Animal('test');
		animal.move();

		var wangcai = new Dog('wangcai', 'black');
		wangcai.move();
		wangcai.wow();

	</script>
</body>
</html>